package com.loongtech.bi.entity.system;

import com.loongtech.core.gen.GenInnerK;
import com.loongtech.core.jpa.entity.EntityIntAutoWithoutVersion;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "system_config")
@GenInnerK
public class EntityConfig extends EntityIntAutoWithoutVersion {
	private static final long serialVersionUID = 1L;
    @Column(columnDefinition = "varchar(255) NOT NULL default ''")
    private String enumName;
    @Column(columnDefinition = "varchar(255) NOT NULL default ''")
    private String enumValue;
    @Column(columnDefinition = "varchar(255) default ''")
    private String description;
    // 游戏名称
    @Transient
    private String gameName;
    // 游戏id
    @Column(columnDefinition = "varchar(255) default ''")
    private String gameId;

    public String getEnumName() {
        return enumName;
    }

    public void setEnumName(String enumName) {
        this.enumName = enumName;
    }

    public String getEnumValue() {
        return enumValue;
    }

    public void setEnumValue(String enumValue) {
        this.enumValue = enumValue;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getGameName() {
        return gameName;
    }

    public void setGameName(String gameName) {
        this.gameName = gameName;
    }

    public String getGameId() {
        return gameId;
    }

    public void setGameId(String gameId) {
        this.gameId = gameId;
    }

    private int version = 1;			//乐观锁

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return "EntityConfig{" +
                "id=" + id +
                ", enumName='" + enumName + '\'' +
                ", enumValue='" + enumValue + '\'' +
                ", description='" + description + '\'' +
                ", gameName='" + gameName + '\'' +
                ", gameId=" + gameId +
                '}';
    }

    public static class K {
        public static final String enumName = "enumName";
        public static final String enumValue = "enumValue";
        public static final String description = "description";
        public static final String id = "id";
        public static final String version = "version";

        //enumName, enumValue, description, id, version,
        public static java.util.List<String> toList() {
            java.util.List<String> list = new java.util.ArrayList<>();
            list.add(enumName);
            list.add(enumValue);
            list.add(description);
            list.add(id);
            list.add(version);
            return list;
        }
    }
}